package com.wat.ext.postProcessor;

import com.wat.service.OrderService;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

@Component
public class BeanPostProcessorTest implements BeanPostProcessor{

//	private int i = 1;
//
//	/**
//	 * BeanPostProcessor 接口
//	 */
//	@Override
//	public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
//		if (bean instanceof OrderService)
//			System.out.println(i++ + ".【BeanPostProcessor-容器级】BeanPostProcessor.postProcessBeforeInitialization() 方法执行了:"
//					+ bean.toString() + ",beanName:" + beanName);
//		return bean;
//	}
//
//	/**
//	 * BeanPostProcessor 接口
//	 */
//	@Override
//	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
//		if (bean instanceof OrderService)
//			System.out.println(i++ + ".【BeanPostProcessor-容器级】BeanPostProcessor.postProcessAfterInitialization() 方法执行了:"
//					+ bean.toString() + ",beanName:" + beanName);
//		return bean;
//	}
}
